﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MyVoteMVC.Domain.VT_Messages>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    相关消息
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   <div style="height: 50px; line-height: 50px;">
       <%if (ViewContext.RouteData.Values["ID"] != null)
         {
             string activityid = ViewContext.RouteData.Values["ID"].ToString();
             string urlReferrer =  "/Home/Details/" + activityid;
       %>
       <a class="t-button" href="<%:urlReferrer %>" style="padding: 5px;">返回活动详细</a>
       <% Html.RenderPartial("AddMessage", new Message() { Activity_ID = activityid }); %>
       <%}
         else
         { %>
          
       <% } %>
   </div>
     <div class="votemessageContainer">
     <%foreach (var message in Model)
       { %>
       <div class="votemessage">
           <div><span class="votemessage-user"><%:message.Created_By %>:</span> <span class="votemessage-content"><%:message.Message_Content %></span>
           </div ><div class="votemessage-date"><%:message.Created_Date %></div>
       </div>

     <%} %>

     <script type="text/javascript">

         function RefreshMessageList(id, name, content, date) {

             var newmsg = ' <div class="votemessage" style="display:none;">'
           + '<div><span class="votemessage-user">' + name + ':</span> <span class="votemessage-content">' + content + '</span>'
           + '</div ><div class="votemessage-date">' + date + '</div>'
      + '</div>';
             var jqmsg = $(newmsg);
             jqmsg.prependTo($('.votemessageContainer'));
             jqmsg.fadeIn(1000);
         }
     </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
<style type="text/css">
.votemessageContainer{
width:600px;
}
.votemessage{
color:#fff;
font-family:"微软雅黑";
padding:10px;
padding-bottom:5px;
border-bottom:1px #fff dotted;
}
.votemessage-user{
font-size:24px;
line-height:24px;
color:orange;
}
.votemessage-content{
font-size:15px;
line-height:24px;
}
.votemessage-date{
font-size:12px;
line-height:13px;
 text-align:right;
}
</style>
</asp:Content>
